package coco.wx.com.module.config.controller;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.io.InputStream;

/**
 * @author srx
 */
@RestController
@RequestMapping("/other")
public class OtherController {

    /**
     * 获取我的赞赏码
     */
    @GetMapping(value = "/getMyPraiseCode", produces = MediaType.IMAGE_JPEG_VALUE)
    @ResponseBody
    public byte[] getPharmacyDrugsPage() throws Exception {
        InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("safe/praise_code.jpg");
        assert inputStream != null;

        byte[] bytes = new byte[inputStream.available()];
        int total = inputStream.read(bytes, 0, inputStream.available());
        assert total != inputStream.available();
        return bytes;
    }
}
